<html>
    <head>
        <title>员工信息表</title>
        <style type="text/css">
            body{text-align: center;}
            #ss{border: 1px solid #000000;
                width: 600px;
                height: 400px;
                text-align: center;}
            .a{
                font-size: 20px;
                font-weight: normal;
            }
            .b{
                font-size: 16px;
            }
        </style>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <h2>员工信息列表</h2>
        快速查询：<input type="text" name="username"/>&nbsp;<input type="submit" value="提交"/>
        <div id="ss">         
            <table>
                <tr class="a">
                    <th>ID</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>学历</th>
                    <th>入职时间</th>
                    <th>部门</th>
                    <th>职务</th>
                    <th>身份证号</th>
                </tr></br>
                 <?php
                        require_once 'ygb.php';
                        $sql = "select * from ygb";
                        $result = $conn->query($sql);
                        
             ?>
            <?php   if ($result ->num_rows > 0) :   ?>
            <?php
                            $rows = $result -> fetch_all(MYSQLI_ASSOC);
                            foreach ($rows as $row):   ?> 
            
                <tr class="b">
                     <th><?php echo $row['id'];  ?></th>
                     <th><?php echo $row['name'];  ?></th>
                     <th><?php echo $row['sex'];  ?></th>
                     <th><?php echo $row['Education'];  ?></th>
                     <th><?php echo $row['Entry Time'];  ?></th>
                     <th><?php echo $row['department'];  ?></th>
                     <th><?php echo $row['position'];   ?></th>
                     <th><?php echo $row['ID card No'];  ?></th>
                </tr></br>
            </table>
         <?php   endforeach; ?>                        
         <?php   else:    ?>
                     <p>0个结果</p>
         <?php  endif; ?>
                                           

            
        </div>
    </body>
</html>